import { DEFAULT_LAYOUT, PAGE_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const ADMIN: AppRouteRecordRaw = {
  path: '/adminmanage',
  name: 'adminmanage',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.adminManage',
    icon: 'icon-user',
    requiresAuth: true,
    order: 7,
  },
  children: [
    {
      path: '/adminmanage',
      name: 'adminmanage',
      component: PAGE_LAYOUT,
      meta: {
        locale: 'menu.adminGroup',
        requiresAuth: true,
      },
      children: [
        {
          path: '/adminrole',
          name: 'Adminrole',
          component: () => import('@/views/role/list.vue'),
          meta: {
            locale: 'menu.adminRole',
            requiresAuth: true,
            roles: ['*'],
          },
        },
        {
          path: '/admin',
          name: 'Admin',
          component: () => import('@/views/admin/index.vue'),
          meta: {
            locale: 'menu.admin',
            requiresAuth: true,
            roles: ['*'],
          },
        },
      ],
    },
    {
      path: '/adminlog',
      name: 'Adminlog',
      component: () => import('@/views/log/list.vue'),
      meta: {
        locale: 'menu.adminLog',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: '/profile',
      name: 'Profile',
      component: () => import('@/views/admin/profile.vue'),
      meta: {
        locale: 'menu.adminProfile',
        requiresAuth: true,
        roles: ['*'],
      },
    },
  ],
};

export default ADMIN;
